<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="nav" content="2" />
<meta name="acc" content="1-2" />
<title>请假流程</title>
<script type="text/javascript" src="<c:url value='/scripts/global.js'/>"></script>
<%@ include file="/common/extjs.jsp"%>
<script type="text/javascript">
	function closeeds() {
		var id = $("input[name='id']").val();
		$(window.parent.addCheck(id));
		$(window.parent.closes());
	}

	$(document).ready(function() {
		$("#dep2").hide();
		
		$("#inputForm").validate({
			event : "blur",
			isTip : true
		});
		
		var projectId = $("input[name='projectId']").val();
		$("#next").click(function() {
			$("#inputForm").submit();
		});

		$("#usern").click(function() {
			UserNameSelector.getView(function(a, c) {
				$("#usern").val(c);
				$("#value1").val(a);
			}, true).show();
		});
		
		$("#userd").click(function() {
			UserNameSelector.getView(function(a, c) {
				$("#userd").val(c);
				$("#value").val(a);
			}, true).show();
		});
	});
	
	function fucc(){
		var outcome = $("#outcome").val();
		if(outcome == '部门审核'){
			$("#dep1").show();
			$("#dep2").hide();
			$("#key1").attr("disabled", false);
			$("#key").attr("disabled", true);
			$("#usern").attr("class","required choose");
			$("#userd").attr("class","choose");
		}else if(outcome == '分管领导审核'){
			$("#dep1").hide();
			$("#dep2").show();
			$("#key1").attr("disabled", true);
			$("#key").attr("disabled", false);
			$("#usern").attr("class","choose");
			$("#userd").attr("class","required choose");
		}else if(outcome == '站长审核'){
			$("#dep1").hide();
			$("#dep2").hide();
			$("#key1").attr("disabled", true);
			$("#key").attr("disabled", true);
			$("#usern").attr("class","choose");
			$("#userd").attr("class","choose");
		}
		
	}
</script>
</head>
<body>
	<form action="${ctx}/human/leave!start.action" id="inputForm"
		method="get" class="yform" target="_parent">
		<input type="hidden" name="id" id="id" value="${id }"> <input
			type="hidden" name="key1" id="key1" value="deptname"><input
			type="hidden" name="key" id="key" value="leadername" disabled="disabled">
			<input type="hidden" name="status" id="status" value="02">
		<div id="caption">
			<h6>${licenseplateNumber}选择部门负责人</h6>
		</div>
		<div>
			<table class="noborder">
				<tr class="type-text">
					<td>个人信息</td>
					<td colspan="3"><select name="outcome" id="outcome" onchange="fucc();">
						<option value="部门审核">普通员工</option>
						<option value="分管领导审核">部门负责人</option>
						<option value="站长审核">分管领导</option>
					</select></td>
				</tr>
				<tr class="type-text" id="dep1">
					<td>部门负责人</td>
					<td colspan="3"><input type="text" id="usern" name="usern"
						class="required choose" readonly="readonly"/> <input type="hidden" name="value1" id="value1"></td>
				</tr>
				<tr class="type-text" id="dep2">
					<td>分管领导</td>
					<td colspan="3"><input type="text" id="userd" name="userd"
						class="choose" readonly="readonly"/> <input type="hidden" name="value" id="value"></td>
				</tr>
			</table>
		</div>
		<div class="type-button">
			<input type="submit" class="submit" value="提交" id=""
				onclick="return isProcess('将上报资料');" /> <input type="button" value="关闭"
				class="reset" onclick="closeeds();" />
		</div>
	</form>
</body>
</html>